// 模拟数据服务
export const mockCrawlerData = {
    // 统计数据
    statistics: [
      { title: '总任务数', value: '1,234', icon: 'Document', trend: 5.2 },
      { title: '运行中任务', value: '32', icon: 'Loading', trend: -2.1 },
      { title: '今日数据量', value: '45,678', icon: 'DataLine', trend: 12.5 },
      { title: '可用账号数', value: '86', icon: 'User', trend: 0 }
    ],
  
    // 平台列表
    platforms: [
      { label: '抖音', value: 'douyin', icon: '/icons/douyin.png' },
      { label: '快手', value: 'kuaishou', icon: '/icons/kuaishou.png' },
      { label: '小红书', value: 'xiaohongshu', icon: '/icons/xiaohongshu.png' },
      { label: '微博', value: 'weibo', icon: '/icons/weibo.png' }
    ],
  
    // 账号列表
    accounts: [
      { id: 1, name: '账号1', status: 'active', lastUsedTime: '2024-03-20 15:30:00' },
      { id: 2, name: '账号2', status: 'active', lastUsedTime: '2024-03-20 14:20:00' },
      { id: 3, name: '账号3', status: 'error', lastUsedTime: '2024-03-19 18:45:00' },
      { id: 4, name: '账号4', status: 'active', lastUsedTime: '2024-03-20 12:10:00' }
    ],
  
    // 代理列表
    proxies: [
      { id: 1, host: '192.168.0.125', port: 8080, type: 'http', status: 'active' },
      { id: 2, host: '192.168.0.125', port: 8080, type: 'http', status: 'active' },
      { id: 3, host: '192.168.0.125', port: 8080, type: 'socks5', status: 'error' }
    ],
  
    // 预览数据
    previewData: {
      columns: [
        { prop: 'userId', label: '用户ID' },
        { prop: 'nickname', label: '昵称' },
        { prop: 'followers', label: '粉丝数' },
        { prop: 'likes', label: '获赞数' },
        { prop: 'posts', label: '作品数' }
      ],
      data: [
        { userId: '12345', nickname: '用户A', followers: '12.5w', likes: '45.8w', posts: '108' },
        { userId: '12346', nickname: '用户B', followers: '8.2w', likes: '32.1w', posts: '89' },
        { userId: '12347', nickname: '用户C', followers: '25.6w', likes: '98.3w', posts: '156' },
        { userId: '12348', nickname: '用户D', followers: '5.4w', likes: '12.7w', posts: '67' },
        { userId: '12349', nickname: '用户E', followers: '16.8w', likes: '56.2w', posts: '203' }
      ]
    }
  }
  
  // 模拟API请求
  export const mockApi = {
    // 获取统计数据
    getStatistics() {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve(mockCrawlerData.statistics)
        }, 500)
      })
    },
  
    // 获取平台列表
    getPlatforms() {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve(mockCrawlerData.platforms)
        }, 300)
      })
    },
  
    // 获取账号列表
    getAccounts(platform) {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve(mockCrawlerData.accounts)
        }, 400)
      })
    },
  
    // 获取代理列表
    getProxies() {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve(mockCrawlerData.proxies)
        }, 400)
      })
    },
  
    // 获取预览数据
    getPreviewData(config) {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve(mockCrawlerData.previewData)
        }, 800)
      })
    },
  
    // 测试账号
    testAccount(account) {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve({ success: true, message: '账号测试成功' })
        }, 1000)
      })
    },
  
    // 测试代理
    testProxy(proxy) {
      return new Promise(resolve => {
        setTimeout(() => {
          resolve({ success: true, message: '代理测试成功' })
        }, 1000)
      })
    }
  }